<?php 
session_start();  
if($_SESSION['user'])
{
require_once("dbconnect.php");
$id=$_SESSION['user'];
//echo $id;
$sql="select * from executives where exe_name='$id';";
$result=mysql_query($sql);
while($row=mysql_fetch_assoc($result))
{
$name=$row['exe_name'];
//echo $name;
$id=$row['id'];
}
}
else 
{
header("Location:login.php");  
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>KK Circuits &amp; Equipments E-Reporting</title>

<link href="css/css.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.6.min.js"></script>	
<script language="javascript" src="js/calendar_eu.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.17.custom.min.js"></script>	
<link rel="stylesheet" href="css/jquery-ui-1.8.17.custom.css">

<script>

	$(function() {
		$( "#datepicker" ).datepicker({ dateFormat: "dd-mm-yy" });
	});
	</script>

</head>

<body>
<form action="enquiry.php" method="post" name="myform"><table width="927" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td height="116" align="left" valign="top" background="images/top-bg.jpg" style="background-repeat:repeat-x; background-position:left top"><table width="927" height="116" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="567"><img src="images/logo.jpg" width="387" height="81" /></td>
        <td width="336" align="right">&nbsp;</td>
        <td width="24">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="600" align="left" valign="top"><table width="927" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="20">&nbsp;</td>
        <td width="643" align="right"><a href="logout.php">
          <span class="logout" >Logout</span>
        </a></td>
        <td width="20">&nbsp;</td>
      </tr>
      <tr>
        <td width="20">&nbsp;</td>
        <td align="center" valign="top" class="heading">New Enquiry </td>
        <td width="20">&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td align="center"><span class="box"><?php echo $_REQUEST['msg']; ?></span></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td align="center" valign="top"><table width="870" border="0" cellspacing="0" cellpadding="0">
       <tr>
            <td align="left" valign="top">
           <table width="895" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="box-border">
                  <tr>
                    <td width="366"><table width="348" border="0" align="center" cellpadding="0" cellspacing="0">
                        <tr>
                          <td width="14">&nbsp;</td>
                          <td width="124">&nbsp;</td>
                          <td width="199">&nbsp;</td>
                          <td width="11">&nbsp;</td>
                        </tr>
                        <tr>
                          <td height="28">&nbsp;</td>
                          <td align="left" valign="top" class="content">Organisation Name</td>
                          <td align="left" valign="top"><input type="text" name="org" id="org" class="form"  value="<?php echo $_GET['org'];?>"/></td>
                          <td align="left" valign="top"></td>
                        </tr>
                        <tr>
                          <td height="5"></td>
                          <td height="5" align="left" valign="top" class="content"></td>
                          <td height="5" align="left" valign="top"></td>
                          <td align="left" valign="top"></td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                          <td align="left" valign="top" class="content">Name Of User </td>
                          <td align="left" valign="top"><input type="text" name="user" id="user" class="form"/></td>
                          <td align="left" valign="top">&nbsp;</td>
                        </tr>
                        <tr>
                          <td height="5"></td>
                          <td height="5" align="left" valign="top" class="content"></td>
                          <td height="5" align="left" valign="top"></td>
                          <td align="left" valign="top"></td>
                        </tr>
                        <tr>
                          <td height="5"></td>
                          <td height="5" align="left" valign="top" class="content"></td>
                          <td height="5" align="left" valign="top"></td>
                          <td align="left" valign="top"></td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                          <td align="left" valign="top" class="content">Due Date </td>
                          <td align="left" valign="top"><input name="dueDate" id="datepicker" type="text" class="form" value="" /></td>
                          <td align="left" valign="top"></td>
                        </tr>
                        <tr>
                          <td height="5"></td>
                          <td height="5" align="left" valign="top" class="content"></td>
                          <td height="5" align="left" valign="top"></td>
                          <td align="left" valign="top"></td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                          <td align="left" valign="top" class="content">Project Name </td>
                          <td align="left" valign="top"><input name="prjname" type="text" class="form" value="" /></td>
                          <td align="left" valign="top">&nbsp;</td>
                        </tr>
                        <tr>
                          <td height="5"></td>
                          <td height="5" align="left" valign="top" class="content"></td>
                          <td height="5" align="left" valign="top"></td>
                          <td align="left" valign="top"></td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                          <td align="left" valign="top" class="content">Opportunity Name </td>
                          <td align="left" valign="top"><input name="opprname" type="text" class="form" value="" /></td>
                          <td align="left" valign="top">&nbsp;</td>
                        </tr>
                        <tr>
                          <td height="5"></td>
                          <td height="5" align="left" valign="top"></td>
                          <td height="5" align="left" valign="top"></td>
                          <td align="left" valign="top"></td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                          <td align="left" valign="top">&nbsp;</td>
                          <td align="left" valign="top">&nbsp;</td>
                          <td align="left" valign="top">&nbsp;</td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                          <td>&nbsp;</td>
                          <td>&nbsp;</td>
                          <td>&nbsp;</td>
                        </tr>
                    </table></td>
                    <td width="330" align="left" valign="top"><table width="348" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td height="21">&nbsp;</td>
                          <td>&nbsp;</td>
                          <td>&nbsp;</td>
                        </tr>
                        <tr>
                          <td width="44">&nbsp;</td>
                          <td align="left" valign="top" class="content">Division</td>
                          <td align="left" valign="top"><input type="text" name="divi" id="divi" class="form"/></td>
                        </tr>
                        <tr>
                          <td height="5"></td>
                          <td height="5" align="left" valign="top" class="content"></td>
                          <td height="5" align="left" valign="top"></td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                          <td align="left" valign="top" class="content">Enquiry Type </td>
                          <td align="left" valign="top"><select name="enqtype" class="form">
                              <option value="">Please Select</option>
                              <option value="TE">Tender Enquiry(TE)</option>
                              <option value="CP">Cash Purchase(CP)</option>
                              <option value="BQ">Budgetary Quotation(BQ)</option>
                          </select></td>
                        </tr>
                        <tr>
                          <td height="5"></td>
                          <td height="5" align="left" valign="top" class="content"></td>
                          <td height="5" align="left" valign="top"></td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                          <td align="left" valign="top" class="content">Bid Type </td>
                          <td align="left" valign="top"><table width="70%" border="0" cellspacing="0" cellpadding="0">
                              <tr>
                                <td width="19%"><input type="checkbox" name="techbid" value="0" />                                </td>
                                <td width="81%" class="content">Technical Bid </td>
                              </tr>
                              <tr>
                                <td height="5"></td>
                                <td height="5" class="content"></td>
                              </tr>
                              <tr>
                                <td><input type="checkbox" name="pricebid" value="0" /></td>
                                <td class="content">Price Bid </td>
                              </tr>
                          </table></td>
                        </tr>
                        <tr>
                          <td height="5"></td>
                          <td height="5" align="left" valign="top" class="content"></td>
                          <td height="5" align="left" valign="top"></td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                          <td align="left" valign="top" class="content">Probability </td>
                          <td align="left" valign="top"><input name="prob" type="text" class="form" value="" /></td>
                        </tr>
                        <tr>
                          <td height="5"></td>
                          <td height="5" align="left" valign="top" class="content"></td>
                          <td height="5" align="left" valign="top"></td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                          <td class="content">Executive Name </td>
                          <td><input name="exeName" type="text" class="form" value="" /></td>
                        </tr>
                        <tr>
                          <td height="5"></td>
                          <td height="5" align="left" valign="top" class="content"></td>
                          <td height="5" align="left" valign="top"></td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                          <td class="content">Quote Currence </td>
                          <td><select name="curr" class="form">
                              <option value="Please Select">Please Select</option>
                              <option value="Rs.">Rs.</option>
                              <option value="Dollar">Dollar</option>
                              <option value="Euro">Euro</option>
                              <option value="Singapore Dollar">Singapore Dollar</option>
                              <option value="Yen">Yen</option>
                              <option value="Pound">Pound</option>
                          </select></td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                          <td class="content">&nbsp;</td>
                          <td>&nbsp;</td>
                        </tr>
                    </table></td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td height="10" align="left" valign="top"></td>
              </tr>
              
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td><table width="892" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#F7A886"  class="tablebox" id="iTable" >
                  <tr>
                    <td width="30" height="40" align="left" valign="middle" background="images/hed-bg.jpg" class="hed"  style="background-repeat:repeat-x">&nbsp;</td>
                    <td width="30" height="30" align="left" valign="middle" background="images/hed-bg.jpg" class="hed"  style="background-repeat:repeat-x">S.No</td>
                    <td width="68" align="left" valign="middle" background="images/hed-bg.jpg" class="hed"   style="background-repeat:repeat-xbgcolor="#FFFFFF"> Part No </td>
                    <td width="124" align="left" valign="middle" background="images/hed-bg.jpg" class="hed"   style="background-repeat:repeat-xbgcolor="#FFFFFF"> Quantity </td>
                    <td width="51" align="left" valign="middle" background="images/hed-bg.jpg" class="hed"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Make</td>
                    <td width="177" align="left" valign="middle" background="images/hed-bg.jpg" class="hed"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Description</td>
                    <td width="90" align="left" valign="middle" background="images/hed-bg.jpg" class="hed"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Application</td>
                    <td width="144" align="left" valign="middle" background="images/hed-bg.jpg" class="hed"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Specification</td>
                  </tr>
                  <tr>
                    <td bgcolor="#FEF5E7"><input type="checkbox" name="checkbox" value="checkbox" /></td>
                    <td bgcolor="#FEF5E7" align="center">1</td>
                    <td align="left" valign="top" bgcolor="#FEF5E7"><input name="prtno[]" type="text" value="" size="5"  class="tablebox-form"/></td>
                    <td align="left" valign="top" bgcolor="#FEF5E7"><input name="qnty[]" type="text" value="" size="5" class="tablebox-form"/></td>
                    <td align="left" valign="top" bgcolor="#FEF5E7"><input name="make[]" type="text" value="" size="5" class="tablebox-form"/></td>
                    <td align="left" valign="top" bgcolor="#FEF5E7"><input name="decri[]" type="text" value="" size="5" class="tablebox-form"/></td>
                    <td align="left" valign="top" bgcolor="#FEF5E7"><input name="applic[]" type="text" value="" size="5" class="tablebox-form"/></td>
                    <td align="left" valign="top" bgcolor="#FEF5E7"><input name="spec[]" type="text" value="" size="5" class="tablebox-form"/></td>
                  </tr>
                  <!-- <tr>
            <td bgcolor="#FFFFFF"><input type="checkbox" name="checkbox" value="checkbox" /></td>
            <td bgcolor="#FFFFFF" align="center">2</td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="prtno[]" type="text" value="" size="5" /></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="qnty[]" type="text" value="" size="5" /></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="make[]" type="text" value="" size="5" /></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="decri[]" type="text" value="" size="5" /></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="applic[]" type="text" value="" size="5" /></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="spec[]" type="text" value="" size="5" /></td>
          </tr>-->
                </table></td>
              </tr>
              <tr>
                <td height="5"></td>
              </tr>
            </table>                       </td>
  </tr>
         
          <tr>
            <td height="10" align="left" valign="top">&nbsp;</td>
          </tr>
          <tr>
            <td align="left" valign="top"><div class="buttton-main">
	        
	        <input type="button" class="button-right" value="Edit" onclick="" />
	        <input type="reset" class="button-right" value="Clear"/>
	        <input type="submit" class="button-right" value="Save"/>
			
          <div class="button-right" onclick="deleteRow('iTable')">Delete Row</div>
		  <div class="button-right" onclick="addRow('iTable')"> Add Row</div>
          </div>          </td>
          </tr>
          <tr>
            <td height="10"></td>
          </tr>
          <tr>
            <td align="right" valign="top">&nbsp;</td>
          </tr>
          
          <tr>
            <td align="left" valign="top">&nbsp;</td>
          </tr>
        </table></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      
    </table></td>
  </tr>
  <tr>
    <td height="40" align="left" valign="top" bgcolor="#0B0B0B">&nbsp;</td>
  </tr>
</table></form>
</body>
</html>
<script language="javascript">

        function addRow(iTable) {
 
            var table = document.getElementById(iTable);
 			var rowCount = table.rows.length;
			var row = table.insertRow(rowCount);
			//row.backgroundColor="#FFFFFF";
		    var cell1 = row.insertCell(0);
			cell1.setAttribute("bgColor","#FFFFFF");
            var element1 = document.createElement("input");
            element1.type = "checkbox";
            cell1.appendChild(element1);
 
            var cell2 = row.insertCell(1);
			cell2.setAttribute("bgColor","#FFFFFF");
			cell2.align="center";
            cell2.innerHTML = rowCount ;
 
            var cell3 = row.insertCell(2);
			cell3.setAttribute("bgColor","#FFFFFF");
			/*cell3.innerHTML='<input name="pno" id="pno"'+rowCount+' type="text" value="" size="5" />';*/
			var element3 = document.createElement("input");
            element3.type = "text";
			element3.name="prtno[]";
			element3.id="pno[]";
			//element3.backgroundColor="#FFFFFF";
			element3.size="3";
            cell3.appendChild(element3);
			
			
			
			var cell4 = row.insertCell(3);
			/*cell4.innerHTML='<input name="qnty" id="qnty"'+rowCount+' type="text" value="" size="5" />';*/
		    cell4.setAttribute("bgColor","#FFFFFF");
			var element4 = document.createElement("input");
            element4.type = "text";
			element4.name="qnty[]";
			element4.id="qnty[]";
			//element4.className="tablebox-form";
			element4.size="3";
            cell4.appendChild(element4);
			
			
			var cell5 = row.insertCell(4);
			cell5.setAttribute("bgColor","#FFFFFF");
			/*cell4.innerHTML='<input name="make" id="make"'+rowCount+' type="text" value="" size="5" />';*/
			var element5 = document.createElement("input");
            element5.type = "text";
			element5.name="make[]";
			element5.id="make[]";
			//element5.className="tablebox-form";
			element5.size="3";
            cell5.appendChild(element5);
			
			var cell6 = row.insertCell(5);
			cell6.setAttribute("bgColor","#FFFFFF");
			/*cell4.innerHTML='<input name="dicr" id="dicr"'+rowCount+' type="text" value="" size="5" />';*/
			var element6 = document.createElement("input");
            element6.type = "text";
			element6.name="decri[]";
			element6.id="dicr[]";
			//element6.className="tablebox-form";
			element6.size="3";
            cell6.appendChild(element6);
			
			 var cell7 = row.insertCell(6);
			/*cell4.innerHTML='<input name="applic" id="applic"'+rowCount+' type="text" value="" size="5" />';
			*/cell7.setAttribute("bgColor","#FFFFFF");
			var element7 = document.createElement("input");
            element7.type = "text";
			element7.name="applic[]";
			element7.id="applic[]";
			//element7.className="tablebox-form";
			element7.size="3";
            cell7.appendChild(element7);
			
			var cell8 = row.insertCell(7);
			cell8.setAttribute("bgColor","#FFFFFF");
			/*cell4.innerHTML='<input name="spec" id="spec"'+rowCount+' type="text" value="" size="5" />';*/
			var element8 = document.createElement("input");
            element8.type = "text";
			element8.name="spec[]";
			element8.id="spec[]";
			//element8.className="tablebox-form";
			element8.size="3";
            cell8.appendChild(element8);
			 }
 
        function deleteRow(iTable) {
            try {
            var table = document.getElementById(iTable);
            var rowCount = table.rows.length;
 
            for(var i=0; i<rowCount; i++) {
                var row = table.rows[i];
                var chkbox = row.cells[0].childNodes[0];
                if(null != chkbox && true == chkbox.checked) {
                    table.deleteRow(i);
                    rowCount--;
                    i--;
                }
 
            }
			for(var i=0; i<rowCount-1; i++)

           table.rows[i+1].cells[1].innerHTML = i+1;
            }catch(e) {
                alert(e);
            }
        }
 
    </script>